package mg.engine.manager.resource;

import mg.system.util.MGArrayList;

public class MGResouce
{
	public int			scene_id					= 0;

	public String		scene_name					= null;

	public int			scene_type					= 0;

	public int			cell_rows					= 0;
	public int			cell_cols					= 0;
	public int			cell_height					= 0;
	public int			cell_width					= 0;
	public int			cell_horizontal_space		= 0;
	public int			cell_vertical_space			= 0;
	public int			cell_horizontal_dislocation	= 0;
	public int			cell_vertical_dislocation	= 0;

	public MGArrayList	layers						= null;

	public MGResouce(int sceneid, String name, int type, int cols, int rows,
			int width, int height, int horizontal_space, int vertical_space,
			int horizontal_dislocation, int vertical_dislocation)
	{
		scene_id = sceneid;
		scene_name = name;
		scene_type = type;
		cell_cols = cols;
		cell_rows = rows;
		cell_width = width;
		cell_height = height;
		cell_horizontal_space = horizontal_space;
		cell_horizontal_dislocation = horizontal_dislocation;
		cell_vertical_space = vertical_space;
		cell_vertical_dislocation = horizontal_dislocation;
	}

	public int createLayer()
	{
		if (layers == null)
		{
			layers = new MGArrayList();
		}
		int index = layers.size();
		layers.add(new MGArrayList());
		return index;
	}

	public boolean addOjectToLayer(int layerid, Object data)
	{
		if (layerid >= layers.size() || layerid < 0)
		{
			return false;
		}
		else
		{
			MGArrayList layer = (MGArrayList) layers.get(layerid);
			layer.add(data);
			return true;
		}
	}

}
